package zheezes.eisp.autotask.model;

import java.util.Calendar;
import java.util.List;

import org.apache.log4j.Logger;

import zheezes.eisp.data.dao.DataAccessor;


public abstract class AbstractAutoTaskCreator {
	private static Logger logger = Logger.getLogger(AbstractAutoTaskCreator.class);
	
	/*
	public static final int RES_METER_DAILY_FROZEN_COLLECT_TASK = 1;
	public static final int VIP_METER_HOUR_FROZEN_COLLECT_TASK = 2;
	public static final int SUMMATOR_DAILY_FROZEN_COLLECT_TASK = 3;
	public static final int SUMMATOR_INSTANT_VALUE_COLLECT_TASK = 4;
	public static final int GROUP_STAT_CALC_TASK = 5;*/
	
	public static final int TASK_LAPSE = 3;
	
	protected DataAccessor dataAccessor;
	protected Calendar schedule = Calendar.getInstance();
	
	private boolean enable = true;
	
	static {
		logger.debug(String.format("loading"));
	}
	
	@SuppressWarnings("rawtypes")
	public abstract List mktask();

	public void setDataAccessor(DataAccessor dataAccessor) {
		if (this.dataAccessor == null) {
			this.dataAccessor = dataAccessor;
		}
	}

	public Calendar getSchedule() {
		return (Calendar) schedule.clone();
	}

	public void setShedule(Calendar cal) {
		schedule.setTime(cal.getTime());
	}
	
	public boolean enable() {
		return enable;
	}
	
	public void setEnable(boolean enable) {
		this.enable = enable;
	}
}
